package com.zjgsu.nftplatform.pojo;

import com.zjgsu.nftplatform.entity.Bargain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.util.Date;

/**
 * @author ahy231
 * @date 2022/4/6 16:38
 * @description
 */
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@ApiModel("议价信息")
public class BargainInfo {
    @ApiModelProperty("主键")
    private String id;
    @ApiModelProperty("商品id")
    private String wareId;
    @ApiModelProperty("商品名称")
    private String wareName;
    @ApiModelProperty("买方id")
    private String buyerId;
    @ApiModelProperty("买方用户名")
    private String buyerName;
    @ApiModelProperty("买方观点")
    private String buyerWords;
    @ApiModelProperty("卖方观点")
    private String sellerWords;
    @ApiModelProperty("当前议价")
    private BigDecimal price;
    @ApiModelProperty("议价状态：1/未处理 2/买家议价中 3/卖家议价中 4/已接受 5/已拒绝")
    private Integer status;
    @ApiModelProperty("开始时间")
    private Date time;

    public BargainInfo(Bargain bargain) {
        this.id = bargain.getId().toString();
        this.wareId = bargain.getWareId().toString();
        this.buyerId = bargain.getBuyerId().toString();
        this.buyerName = bargain.getBuyerName();
        this.buyerWords = bargain.getBuyerWords();
        this.sellerWords = bargain.getSellerWords();
        this.price = bargain.getPrice();
        this.status = bargain.getStatus();
        this.time = bargain.getTime();
    }
}
